package com.tinghua.mqTest.deal;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.tinghua.mqTest.utils.ConnectionMQ;

import java.nio.charset.StandardCharsets;

public class Producter {
    public static void main(String[] args) throws Exception{
        Channel channel = ConnectionMQ.utilConnectionMQ();
        AMQP.BasicProperties properties = new AMQP.BasicProperties().builder().expiration("5000").build();
        channel.basicPublish("myExchange", "keyq1", properties, "test".getBytes(StandardCharsets.UTF_8));
        channel.basicPublish("myExchange", "keyq1", properties, "err".getBytes(StandardCharsets.UTF_8));
    }
}
